package com.amigo.online.provider.manager.controller;

import javax.annotation.Resource;

import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.amigo.online.common.base.controller.BaseController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.provider.manager.model.entity.MerchantEnvironment;
import com.amigo.online.provider.manager.service.MerchantEnvironmentService;

@RestController
@RequestMapping(value = "/merchantEnvironment", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class MerchantEnvironmentController extends BaseController {

    @Resource
    private MerchantEnvironmentService merchantEnvironmentService;

    @PostMapping(value = "/saveMerchantEnvironment")
    public ResponseEntity<Response> saveMerchantEnvironment(@RequestBody MerchantEnvironment merchantEnvironment) {
        return success(merchantEnvironmentService.saveMerchantEnvironment(merchantEnvironment));
    }

    @PostMapping(value = "/getMerchantEnvironmentList")
    public ResponseEntity<Response> getMerchantEnvironmentList(@RequestBody MerchantEnvironment merchantEnvironment) {
        return success(merchantEnvironmentService.getMerchantEnvironmentList(merchantEnvironment));
    }

    @PutMapping(value = "/updateMerchantEnvironment")
    public ResponseEntity<Response> updateMerchantEnvironment(@RequestBody MerchantEnvironment merchantEnvironment) {
        return success(merchantEnvironmentService.updateMerchantEnvironment(merchantEnvironment));
    }

    @PutMapping(value = "/deleteMerchantEnvironment")
    public ResponseEntity<Response> deleteMerchantEnvironment(@RequestBody MerchantEnvironment merchantEnvironment) {
        return success(merchantEnvironmentService.deleteMerchantEnvironment(merchantEnvironment));
    }

}
